package com.hop.thread;

public class RunnableStopTest {
	
	/**
	 * 特定时机终止某一线程的运行，使其进入到死亡状态
	 * @param args
	 */
	public static void main(String[] args){
		MyRunnable myRunnable = new MyRunnable();
		Thread t = new Thread(myRunnable);
		for(int i = 0; i<100; i++){
			System.out.println(Thread.currentThread().getName()+" "+i);
			if(i == 30){
				t.start();
			}
			if(i == 40){
				myRunnable.stop();
			}
		}
	}
}
